#!/bin/sh

# log_load
# File ID: b74fcc82-5d3e-11df-b433-90e6ba3022ac
# Logger maskinload til ~/log/load/ÅÅÅÅ/ÅÅÅÅ-MM-DD.load.log

logdir=$HOME/log

[ -d $logdir ] || mkdir -p logdir || { echo "$0: mkdir $logdir: På trynet" >&2; exit 1; }
[ -x /usr/bin/cronolog ] || { echo "$0: Fant ikke /usr/sbin/cronolog, avbryter." >&2; exit 1; }

(echo -n "`date -u +"%Y-%m-%dT%H:%M:%SZ"` "; cat /proc/loadavg) | /usr/bin/cronolog -z 0 -S $logdir/curr_load $logdir/load/%Y/%Y-%m-%d.load.log
